# -*- encoding=utf8 -*-
        
__author__ = "Bryan.Chen"
__desc__=""
        
from airtest.core.api import *
        
auto_setup(__file__)
        
from poco.drivers.std import StdPoco
poco = StdPoco()
        
using("../FlowTest.air")
import FlowTest
using("SideMenu_Open.air")
import SideMenu_Open
        
class SideMenu_CityNews(FlowTest.BaseTestCase):
    def __init__(self):
        print("%s __init__" % (__file__))
        
    def runTest(self, args):
        print("%s runTest" % (__file__))
        # 打开左侧菜单
        isOpenSideMenu = SideMenu_Open.runTest({})
        if not isOpenSideMenu:
            return False

        # 获取左侧菜单节点
        bottomPanel = poco("bottom_panel")
        if not bottomPanel.exists():
            return False

        btnCityNews = bottomPanel.offspring("news_btn")
        if not btnCityNews.exists():
            return False

        self.clickButton(btnCityNews)

        sleep(2.0)

        keyevent("BACK")
        sleep(1.0)

        poco.click([0.7, 0.5])
        return True
        
_instance = SideMenu_CityNews()
runTest = _instance.runTest